/**
 * Created by sicongdu on 17-11-3.
 */

const express = require('express');
var mark = express.Router();


var student = require('./student');
var teacher = require('./teacher');
var _mark = require('./mark');

mark.get("/st1", function(req, res, next){
    res.render('student1', {layout: null});
});

mark.get("/st2", function(req, res, next){
    res.render('student2', {layout: null});
});

mark.get("/st3", function(req, res, next){
    res.render('student3', {layout: null});
});

mark.get("/st4", function(req, res, next){
    res.render('student4', {layout: null});
});

mark.get("/st5", function(req, res, next){
    res.render('student5', {layout: null});
});

mark.post("/student1", function(req, res, next){
    student(req,res,1);
});

mark.post("/student2", function(req, res, next){
    student(req,res,2);
});

mark.post("/student3", function(req, res, next){
    student(req,res,3);
});

mark.post("/student4", function(req, res, next){
    student(req,res,4);
});

mark.post("/student5", function(req, res, next){
    student(req,res,5);
});

mark.get("/te1", function(req, res, next){
    res.render('teacher1', {layout: null})
});

mark.get("/te2", function(req, res, next){
    res.render('teacher2', {layout: null})
});

mark.get("/te3", function(req, res, next){
    res.render('teacher3', {layout: null})
});

mark.get("/te4", function(req, res, next){
    res.render('teacher4', {layout: null})
});

mark.get("/te5", function(req, res, next){
    res.render('teacher5', {layout: null})
});

mark.post("/teacher1", function(req, res, next){
    teacher(req,res,1);
});

mark.post("/teacher2", function(req, res, next){
    teacher(req,res,2);
});

mark.post("/teacher3", function(req, res, next){
    teacher(req,res,3);
});

mark.post("/teacher4", function(req, res, next){
    teacher(req,res,4);
});

mark.post("/teacher5", function(req, res, next){
    teacher(req,res,5);
});

mark.post("/mark", function(req, res, next){
    _mark(req,res);
});

module.exports = mark;